package com.xxx;

/**
 * @author zr
 * @version 1.0
 * @date 2021/7/3 8:05
 */
public class Client {
    public static void main(String[] args) {
        DemoObserver demoObserver = new DemoObserver();
        DemoSubject demoSubject = new DemoSubject();
        //将观察者添加到被观察者的列表
        demoSubject.attachObserver(demoObserver);
        //触发具体的被观察者的事件源
        demoSubject.onClick();
    }
}
